package web.socket2;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;
import java.util.Arrays;

public class testFileChanle3 {
	
	public static void main(String[] args) throws Exception {
		FileInputStream fip=new FileInputStream(new File("d:zsw.txt"));
		FileChannel channel = fip.getChannel();
		ByteBuffer buffer=ByteBuffer.allocate(1024);
		channel.read(buffer);
		buffer.flip();
		while(buffer.hasRemaining()) {
			byte b = buffer.get();
		 System.out.println(b);
		}
		
		byte[] testByte="a".getBytes();
 		
		System.out.println("cds");
		
		/*byte[] bytes = "曾少文".getBytes();
		System.out.println(Arrays.toString(bytes));*/
	}

}
